import requests

from interface_practice.frame.utils.log_util import logger


class BaseApi:
    def send_api(self,req):
        '''
        对requests  进行封装
        req: 字典格式{
        "method" : 'GET',
        "url": "http://xxxxxx/.xxx",
        "json": None,
        "params": None,
        }
        return:
        '''
        logger.info(f"请求数据为====>{req}")
        r = requests.request(**req)
        logger.info(f"响应数据为<-----{r.text}")
        return r